package com.taobao.demo.user.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 类描述：
 * 
 * @author xhy
 * @date 2025/10/20 18:02
 * @version 1.0.0
 */
@Data
public class PasswordDTO {
    @NotBlank(message = "旧密码不能为空")
    private String oldPassword;
    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[@#$%^&*])[a-zA-Z0-9@#$%^&*]{8,20}$",
            message = "新密码需8-20位，包含数字、字母和特殊字符")
    private String newPassword;
    @NotBlank(message = "id不能为空")
    private Long id;
}
